package com.ty.day1.home;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/14 18:33
 */
public class Test03 {
    public static void main(String[] args) {
        Person p1 = new Person();
        Pet pet = new Pet();
        pet.name="大黄";
        pet.variety="拉布拉多";
        pet.color="red";
        p1.name="ty";
        p1.age=21;
        p1.pet=pet;
        Person p2 = new Person();
        Pet pet1 = new Pet();
        pet1.name="黑黑";
        pet1.variety="维加斯";
        pet1.color="blue";
        p2.name="txy";
        p2.age=22;
        p2.pet=pet1;
        System.out.println(p1);
        System.out.println(p2);
        System.out.println(p1==p2);
        System.out.println(p1.pet==p2.pet);
    }
}
